package org.andao.commons.lucene.search;

import java.util.List;

import org.andao.commons.lucene.bean.ConditionBean;
import org.andao.commons.lucene.core.extractor.DocumentListExtractor;
import org.andao.commons.lucene.core.mapper.IndexMapper;
import org.andao.commons.lucene.exception.LuceneQueryException;
import org.andao.core.dao.helper.Page;
import org.apache.solr.client.solrj.SolrServerException;


/**
 * lucene搜索器
 * 
 * @author Seewo Software - Vick.liu (liuguanglin@cvte.cn)
 * 
 */
public interface LuceneSearcher {

	/**
	 * 检索
	 * 
	 * @param page
	 *            结果分页
	 * @param conditionBeanList
	 *            搜索条件，必须有一个isFilter=false
	 * @param mapper
	 *            结果包装器
	 * @return
	 * @throws LuceneQueryException
	 * @throws SolrServerException
	 */
	public Page query(Page page, List<ConditionBean> conditionBeanList, IndexMapper mapper) throws LuceneQueryException, SolrServerException;

	/**
	 * 检索
	 * 
	 * @param page
	 *            结果分页
	 * @param conditionBeanList
	 *            搜索条件，必须有一个isFilter=false
	 * @param listExtractor
	 *            结果分解器
	 * @return
	 * @throws LuceneQueryException
	 * @throws SolrServerException
	 */
	public Page query(Page page, List<ConditionBean> conditionBeanList, DocumentListExtractor listExtractor) throws LuceneQueryException, SolrServerException;

}
